//----------------------------------------------------------------------------------------------------------------------
// Copyright (c) 2012 James Whitworth
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the 'Software'), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//----------------------------------------------------------------------------------------------------------------------
#include "gmock/gmock.h"
#include "sqbind/sqbBind.h"
#include "../fixtures/SquirrelFixture.h"
#include "../mocks/autogen/MockFunction1.h"
//----------------------------------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------------------------------
// THIS FILE IS AUTO GENERATED DO NOT EDIT.
//----------------------------------------------------------------------------------------------------------------------

namespace autogen
{
//----------------------------------------------------------------------------------------------------------------------
typedef SquirrelFixture BindFunctionTest;

//----------------------------------------------------------------------------------------------------------------------
typedef SquirrelFixture BindClassFunctionTest;

//----------------------------------------------------------------------------------------------------------------------
typedef SquirrelFixture BindSingletonFunctionTest;

//----------------------------------------------------------------------------------------------------------------------
// Test1ParameterReturnVoid
//----------------------------------------------------------------------------------------------------------------------
TEST_F(BindFunctionTest, Test1ParameterReturnVoid)
{
  ::testing::StrictMock<MockFunction1> mock;
  MockFunction1::m_instance = &mock;

  sq_pushroottable(m_vm);
  sqb::Bind::BindClass<BoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("BoundClass"));
  sqb::Bind::BindClass<OtherBoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("OtherBoundClass"));
  sq_poptop(m_vm);

  OtherBoundClass invalidParameter;
  BoundClass parameter0(0);

  EXPECT_CALL(mock, ClassVoidFunction1(parameter0))
    .Times(2);

  // bind the objects required for calling the function
  //
  sq_pushroottable(m_vm);

  EXPECT_TRUE(sqb::Bind::BindFunction(m_vm, -1, &MockFunction1::VoidFunction1, _SC("VoidFunction1")));

  sq_pushstring(m_vm, _SC("Mock"), -1);
  EXPECT_SQ_SUCCEEDED(m_vm, sq_newclass(m_vm, SQFalse));
  EXPECT_TRUE(sqb::Bind::BindFunction(m_vm, 3, &MockFunction1::VoidFunction1, _SC("VoidFunction1")));
  EXPECT_SQ_SUCCEEDED(m_vm, sq_rawset(m_vm, -3));

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &invalidParameter, _SC("invalidParameter")));
  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &parameter0, _SC("parameter0")));
  sq_poptop(m_vm);

  CompileAndSucceedCall("VoidFunction1(parameter0)");
  CompileAndSucceedCall("Mock.VoidFunction1(parameter0)");

  CompileAndFailCall("VoidFunction1(invalidParameter)");
  CheckErrorString("parameter 1 has an invalid type 'OtherBoundClass' ; expected: 'BoundClass'");
}

//----------------------------------------------------------------------------------------------------------------------
// Test1ParameterReturnVoid
//----------------------------------------------------------------------------------------------------------------------
TEST_F(BindClassFunctionTest, Test1ParameterReturnVoid)
{
  ::testing::StrictMock<MockFunction1> mock;
  MockFunction1::m_instance = &mock;

  sq_pushroottable(m_vm);
  sqb::Bind::BindClass<BoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("BoundClass"));
  sqb::Bind::BindClass<OtherBoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("OtherBoundClass"));
  sq_poptop(m_vm);

  OtherBoundClass invalidParameter;
  BoundClass parameter0(0);

  EXPECT_CALL(mock, ClassVoidFunction1(parameter0))
    .Times(1);
  EXPECT_CALL(mock, ConstClassVoidFunction1(parameter0))
    .Times(1);

  // bind the objects required for calling the function
  //
  sq_pushroottable(m_vm);

  // bind the mock class
  //
  EXPECT_SQ_SUCCEEDED(m_vm, sq_newclass(m_vm, SQFalse));
  EXPECT_SQ_SUCCEEDED(m_vm, sq_settypetag(m_vm, -1, sqb::ClassTypeTag<MockFunction1>::Get()));
  HSQOBJECT class_object;
  sq_getstackobj(m_vm, -1, &class_object);
  sqb::ClassTypeTag<MockFunction1>::Get()->SetClassObject(m_vm, class_object);
  EXPECT_TRUE(sqb::Bind::BindClassFunction<MockFunction1>(m_vm, -1, &MockFunction1::ClassVoidFunction1, _SC("ClassVoidFunction1")));
  EXPECT_TRUE(sqb::Bind::BindClassFunction<MockFunction1>(m_vm, 2, &MockFunction1::ConstClassVoidFunction1, _SC("ConstClassVoidFunction1")));
  sq_poptop(m_vm);

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, static_cast<MockFunction1 *>(&mock), _SC("mock")));

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &invalidParameter, _SC("invalidParameter")));
  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &parameter0, _SC("parameter0")));
  sq_poptop(m_vm);

  CompileAndSucceedCall("mock.ClassVoidFunction1(parameter0)");
  CompileAndSucceedCall("mock.ConstClassVoidFunction1(parameter0)");

  CompileAndFailCall("mock.ClassVoidFunction1(invalidParameter)");
  CheckErrorString("parameter 1 has an invalid type 'OtherBoundClass' ; expected: 'BoundClass'");
  CompileAndFailCall("mock.ConstClassVoidFunction1(invalidParameter)");
  CheckErrorString("parameter 1 has an invalid type 'OtherBoundClass' ; expected: 'BoundClass'");
}

//----------------------------------------------------------------------------------------------------------------------
// Test1ParameterReturnVoid
//----------------------------------------------------------------------------------------------------------------------
TEST_F(BindSingletonFunctionTest, Test1ParameterReturnVoid)
{
  ::testing::StrictMock<MockFunction1> mock;
  MockFunction1::m_instance = &mock;

  sq_pushroottable(m_vm);
  sqb::Bind::BindClass<BoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("BoundClass"));
  sqb::Bind::BindClass<OtherBoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("OtherBoundClass"));
  sq_poptop(m_vm);

  OtherBoundClass invalidParameter;
  BoundClass parameter0(0);

  EXPECT_CALL(mock, ClassVoidFunction1(parameter0))
    .Times(1);
  EXPECT_CALL(mock, ConstClassVoidFunction1(parameter0))
    .Times(1);

  // bind the objects required for calling the function
  //
  sq_pushroottable(m_vm);

  // bind the mock class
  //
  sq_pushstring(m_vm, _SC("Mock"), -1);
  EXPECT_SQ_SUCCEEDED(m_vm, sq_newclass(m_vm, SQFalse));
  EXPECT_TRUE(sqb::Bind::BindSingletonFunction<MockFunction1>(m_vm, -1, &mock, &MockFunction1::ClassVoidFunction1, _SC("ClassVoidFunction1")));
  EXPECT_TRUE(sqb::Bind::BindSingletonFunction<MockFunction1>(m_vm, 1, &mock, &MockFunction1::ConstClassVoidFunction1, _SC("ConstClassVoidFunction1")));
  EXPECT_SQ_SUCCEEDED(m_vm, sq_rawset(m_vm, -3));

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &invalidParameter, _SC("invalidParameter")));
  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &parameter0, _SC("parameter0")));
  sq_poptop(m_vm);

  CompileAndSucceedCall("Mock.ClassVoidFunction1(parameter0)");
  CompileAndSucceedCall("ConstClassVoidFunction1(parameter0)");

  CompileAndFailCall("Mock.ClassVoidFunction1(invalidParameter)");
  CheckErrorString("parameter 1 has an invalid type 'OtherBoundClass' ; expected: 'BoundClass'");
  CompileAndFailCall("ConstClassVoidFunction1(invalidParameter)");
  CheckErrorString("parameter 1 has an invalid type 'OtherBoundClass' ; expected: 'BoundClass'");
}

//----------------------------------------------------------------------------------------------------------------------
// Test1Parameter
//----------------------------------------------------------------------------------------------------------------------
TEST_F(BindFunctionTest, Test1Parameter)
{
  ::testing::StrictMock<MockFunction1> mock;
  MockFunction1::m_instance = &mock;

  sq_pushroottable(m_vm);
  sqb::Bind::BindClass<BoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("BoundClass"));
  sqb::Bind::BindClass<OtherBoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("OtherBoundClass"));
  sq_poptop(m_vm);

  OtherBoundClass invalidParameter;
  BoundClass parameter0(0);

  BoundClass expected_result(0xffffffff);
  EXPECT_CALL(mock, ClassFunction1(parameter0))
    .Times(2)
    .WillRepeatedly(::testing::Return(expected_result));

  // bind the objects required for calling the function
  //
  sq_pushroottable(m_vm);

  EXPECT_TRUE(sqb::Bind::BindFunction(m_vm, -1, &MockFunction1::Function1, _SC("Function1")));

  sq_pushstring(m_vm, _SC("Mock"), -1);
  EXPECT_SQ_SUCCEEDED(m_vm, sq_newclass(m_vm, SQFalse));
  EXPECT_TRUE(sqb::Bind::BindFunction(m_vm, 3, &MockFunction1::Function1, _SC("Function1")));
  EXPECT_SQ_SUCCEEDED(m_vm, sq_rawset(m_vm, -3));

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &invalidParameter, _SC("invalidParameter")));
  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &parameter0, _SC("parameter0")));
  sq_poptop(m_vm);

  BoundClass actual_result = CompileAndCallReturnResult<BoundClass>("return Function1(parameter0)");
  EXPECT_EQ(expected_result, actual_result);
  actual_result = CompileAndCallReturnResult<BoundClass>("return Mock.Function1(parameter0)");
  EXPECT_EQ(expected_result, actual_result);

  CompileAndFailCall("Function1(invalidParameter)");
  CheckErrorString("parameter 1 has an invalid type 'OtherBoundClass' ; expected: 'BoundClass'");
}

//----------------------------------------------------------------------------------------------------------------------
// Test1Parameter
//----------------------------------------------------------------------------------------------------------------------
TEST_F(BindClassFunctionTest, Test1Parameter)
{
  ::testing::StrictMock<MockFunction1> mock;
  MockFunction1::m_instance = &mock;

  sq_pushroottable(m_vm);
  sqb::Bind::BindClass<BoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("BoundClass"));
  sqb::Bind::BindClass<OtherBoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("OtherBoundClass"));
  sq_poptop(m_vm);

  OtherBoundClass invalidParameter;
  BoundClass parameter0(0);

  BoundClass expected_result(0xffffffff);
  EXPECT_CALL(mock, ClassFunction1(parameter0))
    .WillOnce(::testing::Return(expected_result));
  EXPECT_CALL(mock, ConstClassFunction1(parameter0))
    .WillOnce(::testing::Return(expected_result));

  // bind the objects required for calling the function
  //
  sq_pushroottable(m_vm);

  // bind the mock class
  //
  EXPECT_SQ_SUCCEEDED(m_vm, sq_newclass(m_vm, SQFalse));
  EXPECT_SQ_SUCCEEDED(m_vm, sq_settypetag(m_vm, -1, sqb::ClassTypeTag<MockFunction1>::Get()));
  HSQOBJECT class_object;
  sq_getstackobj(m_vm, -1, &class_object);
  sqb::ClassTypeTag<MockFunction1>::Get()->SetClassObject(m_vm, class_object);
  EXPECT_TRUE(sqb::Bind::BindClassFunction<MockFunction1>(m_vm, -1, &MockFunction1::ClassFunction1, _SC("ClassFunction1")));
  EXPECT_TRUE(sqb::Bind::BindClassFunction<MockFunction1>(m_vm, 2, &MockFunction1::ConstClassFunction1, _SC("ConstClassFunction1")));
  sq_poptop(m_vm);

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, static_cast<MockFunction1 *>(&mock), _SC("mock")));

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &invalidParameter, _SC("invalidParameter")));
  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &parameter0, _SC("parameter0")));
  sq_poptop(m_vm);

  BoundClass actual_result = CompileAndCallReturnResult<BoundClass>("return mock.ClassFunction1(parameter0)");
  EXPECT_EQ(expected_result, actual_result);
  actual_result = CompileAndCallReturnResult<BoundClass>("return mock.ConstClassFunction1(parameter0)");
  EXPECT_EQ(expected_result, actual_result);

  CompileAndFailCall("mock.ClassFunction1(invalidParameter)");
  CheckErrorString("parameter 1 has an invalid type 'OtherBoundClass' ; expected: 'BoundClass'");
  CompileAndFailCall("mock.ConstClassFunction1(invalidParameter)");
  CheckErrorString("parameter 1 has an invalid type 'OtherBoundClass' ; expected: 'BoundClass'");
}

//----------------------------------------------------------------------------------------------------------------------
// Test1Parameter
//----------------------------------------------------------------------------------------------------------------------
TEST_F(BindSingletonFunctionTest, Test1Parameter)
{
  ::testing::StrictMock<MockFunction1> mock;
  MockFunction1::m_instance = &mock;

  sq_pushroottable(m_vm);
  sqb::Bind::BindClass<BoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("BoundClass"));
  sqb::Bind::BindClass<OtherBoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("OtherBoundClass"));
  sq_poptop(m_vm);

  OtherBoundClass invalidParameter;
  BoundClass parameter0(0);

  BoundClass expected_result(0xffffffff);
  EXPECT_CALL(mock, ClassFunction1(parameter0))
    .WillOnce(::testing::Return(expected_result));
  EXPECT_CALL(mock, ConstClassFunction1(parameter0))
    .WillOnce(::testing::Return(expected_result));

  // bind the objects required for calling the function
  //
  sq_pushroottable(m_vm);

  // bind the mock class
  //
  sq_pushstring(m_vm, _SC("Mock"), -1);
  EXPECT_SQ_SUCCEEDED(m_vm, sq_newclass(m_vm, SQFalse));
  EXPECT_TRUE(sqb::Bind::BindSingletonFunction<MockFunction1>(m_vm, -1, &mock, &MockFunction1::ClassFunction1, _SC("ClassFunction1")));
  EXPECT_TRUE(sqb::Bind::BindSingletonFunction<MockFunction1>(m_vm, 1, &mock, &MockFunction1::ConstClassFunction1, _SC("ConstClassFunction1")));
  EXPECT_SQ_SUCCEEDED(m_vm, sq_rawset(m_vm, -3));

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &invalidParameter, _SC("invalidParameter")));
  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &parameter0, _SC("parameter0")));
  sq_poptop(m_vm);

  BoundClass actual_result = CompileAndCallReturnResult<BoundClass>("return Mock.ClassFunction1(parameter0)");
  EXPECT_EQ(expected_result, actual_result);
  actual_result = CompileAndCallReturnResult<BoundClass>("return ConstClassFunction1(parameter0)");
  EXPECT_EQ(expected_result, actual_result);

  CompileAndFailCall("Mock.ClassFunction1(invalidParameter)");
  CheckErrorString("parameter 1 has an invalid type 'OtherBoundClass' ; expected: 'BoundClass'");
  CompileAndFailCall("ConstClassFunction1(invalidParameter)");
  CheckErrorString("parameter 1 has an invalid type 'OtherBoundClass' ; expected: 'BoundClass'");
}

//----------------------------------------------------------------------------------------------------------------------
// Test1ParameterReturnInvalid
//----------------------------------------------------------------------------------------------------------------------
TEST_F(BindFunctionTest, Test1ParameterReturnInvalid)
{
  ::testing::StrictMock<MockFunction1> mock;
  MockFunction1::m_instance = &mock;

  sq_pushroottable(m_vm);
  sqb::Bind::BindClass<BoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("BoundClass"));
  sqb::Bind::BindClass<OtherBoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("OtherBoundClass"));
  sq_poptop(m_vm);

  BoundClass parameter0(0);

  InvalidStackUtilsClass expected_result;
  EXPECT_CALL(mock, ClassInvalidFunction1(parameter0))
    .Times(2)
    .WillRepeatedly(::testing::Return(expected_result));

  // bind the objects required for calling the function
  //
  sq_pushroottable(m_vm);

  EXPECT_TRUE(sqb::Bind::BindFunction(m_vm, -1, &MockFunction1::InvalidFunction1, _SC("InvalidFunction1")));

  sq_pushstring(m_vm, _SC("Mock"), -1);
  EXPECT_SQ_SUCCEEDED(m_vm, sq_newclass(m_vm, SQFalse));
  EXPECT_TRUE(sqb::Bind::BindFunction(m_vm, 3, &MockFunction1::InvalidFunction1, _SC("InvalidFunction1")));
  EXPECT_SQ_SUCCEEDED(m_vm, sq_rawset(m_vm, -3));

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &parameter0, _SC("parameter0")));
  sq_poptop(m_vm);

  CompileAndFailCall("InvalidFunction1(parameter0)");
  CheckErrorString("error returning object of type 'InvalidStackUtilsClass'");
  CompileAndFailCall("Mock.InvalidFunction1(parameter0)");
  CheckErrorString("error returning object of type 'InvalidStackUtilsClass'");
}

//----------------------------------------------------------------------------------------------------------------------
// Test1ParameterReturnInvalid
//----------------------------------------------------------------------------------------------------------------------
TEST_F(BindClassFunctionTest, Test1ParameterReturnInvalid)
{
  ::testing::StrictMock<MockFunction1> mock;
  MockFunction1::m_instance = &mock;

  sq_pushroottable(m_vm);
  sqb::Bind::BindClass<BoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("BoundClass"));
  sqb::Bind::BindClass<OtherBoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("OtherBoundClass"));
  sq_poptop(m_vm);

  BoundClass parameter0(0);

  InvalidStackUtilsClass expected_result;
  EXPECT_CALL(mock, ClassInvalidFunction1(parameter0))
    .WillOnce(::testing::Return(expected_result));
  EXPECT_CALL(mock, ConstClassInvalidFunction1(parameter0))
    .WillOnce(::testing::Return(expected_result));

  // bind the objects required for calling the function
  //
  sq_pushroottable(m_vm);

  // bind the mock class
  //
  EXPECT_SQ_SUCCEEDED(m_vm, sq_newclass(m_vm, SQFalse));
  EXPECT_SQ_SUCCEEDED(m_vm, sq_settypetag(m_vm, -1, sqb::ClassTypeTag<MockFunction1>::Get()));
  HSQOBJECT class_object;
  sq_getstackobj(m_vm, -1, &class_object);
  sqb::ClassTypeTag<MockFunction1>::Get()->SetClassObject(m_vm, class_object);
  EXPECT_TRUE(sqb::Bind::BindClassFunction<MockFunction1>(m_vm, -1, &MockFunction1::ClassInvalidFunction1, _SC("ClassInvalidFunction1")));
  EXPECT_TRUE(sqb::Bind::BindClassFunction<MockFunction1>(m_vm, 2, &MockFunction1::ConstClassInvalidFunction1, _SC("ConstClassInvalidFunction1")));
  sq_poptop(m_vm);

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, static_cast<MockFunction1 *>(&mock), _SC("mock")));

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &parameter0, _SC("parameter0")));
  sq_poptop(m_vm);

  CompileAndFailCall("mock.ClassInvalidFunction1(parameter0)");
  CheckErrorString("error returning object of type 'InvalidStackUtilsClass'");
  CompileAndFailCall("mock.ConstClassInvalidFunction1(parameter0)");
  CheckErrorString("error returning object of type 'InvalidStackUtilsClass'");
}

//----------------------------------------------------------------------------------------------------------------------
// Test1ParameterReturnInvalid
//----------------------------------------------------------------------------------------------------------------------
TEST_F(BindSingletonFunctionTest, Test1ParameterReturnInvalid)
{
  ::testing::StrictMock<MockFunction1> mock;
  MockFunction1::m_instance = &mock;

  sq_pushroottable(m_vm);
  sqb::Bind::BindClass<BoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("BoundClass"));
  sqb::Bind::BindClass<OtherBoundClass, sqb::NoBaseClass>(m_vm, -1, _SC("OtherBoundClass"));
  sq_poptop(m_vm);

  BoundClass parameter0(0);

  InvalidStackUtilsClass expected_result;
  EXPECT_CALL(mock, ClassInvalidFunction1(parameter0))
    .WillOnce(::testing::Return(expected_result));
  EXPECT_CALL(mock, ConstClassInvalidFunction1(parameter0))
    .WillOnce(::testing::Return(expected_result));

  // bind the objects required for calling the function
  //
  sq_pushroottable(m_vm);

  // bind the mock class
  //
  sq_pushstring(m_vm, _SC("Mock"), -1);
  EXPECT_SQ_SUCCEEDED(m_vm, sq_newclass(m_vm, SQFalse));
  EXPECT_TRUE(sqb::Bind::BindSingletonFunction<MockFunction1>(m_vm, -1, &mock, &MockFunction1::ClassInvalidFunction1, _SC("ClassInvalidFunction1")));
  EXPECT_TRUE(sqb::Bind::BindSingletonFunction<MockFunction1>(m_vm, 1, &mock, &MockFunction1::ConstClassInvalidFunction1, _SC("ConstClassInvalidFunction1")));
  EXPECT_SQ_SUCCEEDED(m_vm, sq_rawset(m_vm, -3));

  EXPECT_TRUE(sqb::Bind::BindVariable(m_vm, -1, &parameter0, _SC("parameter0")));
  sq_poptop(m_vm);

  CompileAndFailCall("Mock.ClassInvalidFunction1(parameter0)");
  CheckErrorString("error returning object of type 'InvalidStackUtilsClass'");
  CompileAndFailCall("ConstClassInvalidFunction1(parameter0)");
  CheckErrorString("error returning object of type 'InvalidStackUtilsClass'");
}

} // namespace autogen
